home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 May (DVD) / Macworld Resource DVD May 2003.toast / Data / Software / Bonus / Database / mysql-max-3.23.55.sit / mysql-max-3.23.55-apple-darwi.1 / support-files / mysql-3.23.55.spec < prev    next >
Encoding:
Text File  |  2003-01-22  |  15.3 KB  |  505 lines  |  [TEXT/ttxt]

  1. %define mysql_version        3.23.55
  2. %define shared_lib_version    10:0:0
  3. %define release            1
  4. %define mysqld_user        mysql
  5.  
  6. %define see_base For a description of MySQL see the base MySQL RPM or http://www.mysql.com
  7.  
  8. Name: MySQL
  9. Summary:    MySQL: a very fast and reliable SQL database engine
  10. Group:        Applications/Databases
  11. Summary(pt_BR): MySQL: Um servidor SQL r·pido e confi·vel.
  12. Group(pt_BR):    AplicaÁıes/Banco_de_Dados
  13. Version:    3.23.55
  14. Release:    %{release}
  15. Copyright:    GPL / LGPL
  16. Source:        http://www.mysql.com/Downloads/MySQL-3.23/mysql-%{mysql_version}.tar.gz
  17. Icon:        mysql.gif
  18. URL:        http://www.mysql.com/
  19. Packager:    Lenz Grimmer <lenz@mysql.com>
  20. Vendor:        MySQL AB
  21. Requires: fileutils sh-utils
  22. Provides:    msqlormysql MySQL-server mysql
  23. Obsoletes:    mysql
  24.  
  25. # Think about what you use here since the first step is to
  26. # run a rm -rf
  27. BuildRoot:    %{_tmppath}/%{name}-%{version}-build
  28.  
  29. # From the manual
  30. %description
  31. The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  32. and robust SQL (Structured Query Language) database server. MySQL Server
  33. is intended for mission-critical, heavy-load production systems as well
  34. as for embedding into mass-deployed software. MySQL is a trademark of
  35. MySQL AB.
  36.  
  37. The MySQL software has Dual Licensing, which means you can use the MySQL
  38. software free of charge under the GNU General Public License
  39. (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
  40. licenses from MySQL AB if you do not wish to be bound by the terms of
  41. the GPL. See the chapter "Licensing and Support" in the manual for
  42. further info.
  43.  
  44. The MySQL web site (http://www.mysql.com/) provides the latest
  45. news and information about the MySQL software. Also please see the
  46. documentation and the manual for more information.
  47.  
  48. %package client
  49. Release: %{release}
  50. Summary: MySQL - Client
  51. Group: Applications/Databases
  52. Summary(pt_BR): MySQL - Cliente
  53. Group(pt_BR): AplicaÁıes/Banco_de_Dados
  54. Obsoletes: mysql-client
  55. Provides: mysql-client
  56.  
  57. %description client
  58. This package contains the standard MySQL clients. 
  59.  
  60. %{see_base}
  61.  
  62. %description client -l pt_BR
  63. Este pacote contÈm os clientes padr„o para o MySQL.
  64.  
  65. %package bench
  66. Release: %{release}
  67. Requires: %{name}-client MySQL-DBI-perl-bin perl
  68. Summary: MySQL - Benchmarks and test system
  69. Group: Applications/Databases
  70. Summary(pt_BR): MySQL - MediÁıes de desempenho
  71. Group(pt_BR): AplicaÁıes/Banco_de_Dados
  72. Provides: mysql-bench
  73. Obsoletes: mysql-bench
  74.  
  75. %description bench
  76. This package contains MySQL benchmark scripts and data.
  77.  
  78. %{see_base}
  79.  
  80. %description bench -l pt_BR
  81. Este pacote contÈm mediÁıes de desempenho de scripts e dados do MySQL.
  82.  
  83. %package devel
  84. Release: %{release}
  85. Requires: %{name}-client
  86. Summary: MySQL - Development header files and libraries
  87. Group: Applications/Databases
  88. Summary(pt_BR): MySQL - MediÁıes de desempenho
  89. Group(pt_BR): AplicaÁıes/Banco_de_Dados
  90. Provides: mysql-devel
  91. Obsoletes: mysql-devel
  92.  
  93. %description devel
  94. This package contains the development header files and libraries
  95. necessary to develop MySQL client applications.
  96.  
  97. %{see_base}
  98.  
  99. %description devel -l pt_BR
  100. Este pacote contÈm os arquivos de cabeÁalho (header files) e bibliotecas 
  101. necess·rias para desenvolver aplicaÁıes clientes do MySQL. 
  102.  
  103. %package shared
  104. Release: %{release}
  105. Summary: MySQL - Shared libraries
  106. Group: Applications/Databases
  107.  
  108. %description shared
  109. This package contains the shared libraries (*.so*) which certain
  110. languages and applications need to dynamically load and use MySQL.
  111.  
  112. %package Max
  113. Release: %{release}
  114. Summary: MySQL - server with Berkeley DB and Innodb support
  115. Group: Applications/Databases
  116. Provides: mysql-Max
  117. Obsoletes: mysql-Max
  118. Requires: MySQL = %{version}
  119.  
  120. %description Max 
  121. Optional MySQL server binary that supports features
  122. like transactional tables. To active this binary, just install this
  123. package after the MySQL package.
  124.  
  125. %prep
  126. %setup -n mysql-%{mysql_version}
  127.  
  128. %build
  129. # The all-static flag is to make the RPM work on different
  130. # distributions. This version tries to put shared mysqlclient libraries
  131. # in a separate package.
  132.  
  133. BuildMySQL() {
  134. # The --enable-assembler simply does nothing on systems that does not
  135. # support assembler speedups.
  136. sh -c  "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
  137.     CC=\"${MYSQL_BUILD_CC:-gcc}\" \
  138.     CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O3}\" \
  139.     CXX=\"${MYSQL_BUILD_CXX:-gcc}\" \
  140.     CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O3 \
  141.               -felide-constructors -fno-exceptions -fno-rtti \
  142.           }\" \
  143.     ./configure \
  144.          $* \
  145.         --enable-assembler \
  146.         --enable-local-infile \
  147.             --with-mysqld-user=%{mysqld_user} \
  148.             --with-unix-socket-path=/var/lib/mysql/mysql.sock \
  149.             --prefix=/ \
  150.         --with-extra-charsets=complex \
  151.             --exec-prefix=/usr \
  152.             --libexecdir=/usr/sbin \
  153.             --sysconfdir=/etc \
  154.             --datadir=/usr/share \
  155.             --localstatedir=/var/lib/mysql \
  156.             --infodir=%{_infodir} \
  157.             --includedir=/usr/include \
  158.             --mandir=%{_mandir} \
  159.         --with-comment=\"Official MySQL RPM\";
  160.         # Add this for more debugging support
  161.         # --with-debug
  162.         # Add this for MyISAM RAID support:
  163.         # --with-raid
  164.         "
  165.  
  166.  # benchdir does not fit in above model. Maybe a separate bench distribution
  167.  make benchdir_root=$RPM_BUILD_ROOT/usr/share/
  168. }
  169.  
  170. # Use our own copy of glibc
  171.  
  172. OTHER_LIBC_DIR=/usr/local/mysql-glibc
  173. USE_OTHER_LIBC_DIR=""
  174. if test -d "$OTHER_LIBC_DIR"
  175. then
  176.   USE_OTHER_LIBC_DIR="--with-other-libc=$OTHER_LIBC_DIR"
  177. fi
  178.  
  179. # Use the build root for temporary storage of the shared libraries.
  180.  
  181. RBR=$RPM_BUILD_ROOT
  182. MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
  183.  
  184. # Clean up the BuildRoot first
  185. [ "$RBR" != "/" ] && [ -d $RBR ] && rm -rf $RBR;
  186. mkdir -p $RBR
  187.  
  188. #
  189. # Use MYSQL_BUILD_PATH so that we can use a dedicated version of gcc
  190. #
  191. PATH=${MYSQL_BUILD_PATH:-/bin:/usr/bin}
  192. export PATH
  193.  
  194. # We need to build shared libraries separate from mysqld-max because we
  195. # are using --with-other-libc
  196.  
  197. BuildMySQL "--disable-shared $USE_OTHER_LIBC_DIR --with-berkeley-db --with-innodb --with-mysqld-ldflags='-all-static' --with-server-suffix='-Max'"
  198.  
  199. # Save everything for debug
  200. # tar cf $RBR/all.tar .
  201.  
  202. # Save mysqld-max
  203. mv sql/mysqld sql/mysqld-max
  204. nm --numeric-sort sql/mysqld-max > sql/mysqld-max.sym
  205.  
  206. # Save manual to avoid rebuilding
  207. mv Docs/manual.ps Docs/manual.ps.save
  208. make distclean
  209. mv Docs/manual.ps.save Docs/manual.ps
  210.  
  211. #now build and save shared libraries
  212. BuildMySQL "--enable-shared --enable-thread-safe-client --without-server "
  213. (cd libmysql/.libs; tar cf $RBR/shared-libs.tar *.so*)
  214. (cd libmysql_r/.libs; tar rf $RBR/shared-libs.tar *.so*)
  215.  
  216. # Save manual to avoid rebuilding
  217. mv Docs/manual.ps Docs/manual.ps.save
  218. make distclean
  219. mv Docs/manual.ps.save Docs/manual.ps
  220.  
  221. # RPM:s destroys Makefile.in files, so we generate them here
  222. automake
  223.  
  224. BuildMySQL "--disable-shared" \
  225.        "--with-mysqld-ldflags='-all-static'" \
  226.        "--with-client-ldflags='-all-static'" \
  227.          "$USE_OTHER_LIBC_DIR" \
  228.        "--without-berkeley-db --without-innodb"
  229. nm --numeric-sort sql/mysqld > sql/mysqld.sym
  230.  
  231. %install -n mysql-%{mysql_version}
  232. RBR=$RPM_BUILD_ROOT
  233. MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
  234. # Ensure that needed directories exists
  235. install -d $RBR/etc/{logrotate.d,rc.d/init.d}
  236. install -d $RBR/var/lib/mysql/mysql
  237. install -d $RBR/usr/share/{sql-bench,mysql-test}
  238. install -d $RBR%{_mandir}
  239. install -d $RBR/usr/{sbin,lib,include}
  240.  
  241. # Install all binaries stripped
  242. make install-strip DESTDIR=$RBR benchdir_root=/usr/share/
  243.  
  244. # Install shared libraries (Disable for architectures that don't support it)
  245. (cd $RBR/usr/lib; tar xf $RBR/shared-libs.tar)
  246.  
  247. # install and strip saved mysqld-max
  248. install -s -m755 $MBD/sql/mysqld-max $RBR/usr/sbin/mysqld-max
  249.  
  250. # install symbol files ( for stack trace resolution)
  251. install -m644 $MBD/sql/mysqld-max.sym $RBR/usr/lib/mysql/mysqld-max.sym
  252. install -m644 $MBD/sql/mysqld.sym $RBR/usr/lib/mysql/mysqld.sym
  253.  
  254. # Install logrotate and autostart
  255. install -m644 $MBD/support-files/mysql-log-rotate $RBR/etc/logrotate.d/mysql
  256. install -m755 $MBD/support-files/mysql.server $RBR/etc/rc.d/init.d/mysql
  257.  
  258. %pre
  259. if test -x /etc/rc.d/init.d/mysql
  260. then
  261.   /etc/rc.d/init.d/mysql stop > /dev/null 2>&1
  262.   echo "Giving mysqld a couple of seconds to exit nicely"
  263.   sleep 5
  264. fi
  265.  
  266. %post
  267. mysql_datadir=/var/lib/mysql
  268.  
  269. # Create data directory if needed
  270. if test ! -d $mysql_datadir;        then mkdir $mysql_datadir; fi
  271. if test ! -d $mysql_datadir/mysql;    then mkdir $mysql_datadir/mysql; fi
  272. if test ! -d $mysql_datadir/test;    then mkdir $mysql_datadir/test; fi
  273.  
  274. # Make MySQL start/shutdown automatically when the machine does it.
  275. /sbin/chkconfig --add mysql
  276.  
  277. # Create a MySQL user. Do not report any problems if it already
  278. # exists. This is redhat specific and should be handled more portable
  279. useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" mysql 2> /dev/null || true 
  280.  
  281. # Change permissions so that the user that will run the MySQL daemon
  282. # owns all database files.
  283. chown -R mysql $mysql_datadir
  284.  
  285. # Initiate databases
  286. mysql_install_db -IN-RPM
  287.  
  288. # Change permissions again to fix any new files.
  289. chown -R mysql $mysql_datadir
  290.  
  291. # Fix permissions for the permission database so that only the user
  292. # can read them.
  293. chmod -R og-rw $mysql_datadir/mysql
  294.  
  295. # Restart in the same way that mysqld will be started normally.
  296. /etc/rc.d/init.d/mysql start
  297.  
  298. # Allow safe_mysqld to start mysqld and print a message before we exit
  299. sleep 2
  300.  
  301. %post Max
  302. # Restart mysqld, to use the new binary.
  303. # There may be a better way to handle this.
  304. /etc/rc.d/init.d/mysql stop > /dev/null 2>&1
  305. echo "Giving mysqld a couple of seconds to restart"
  306. sleep 5
  307. /etc/rc.d/init.d/mysql start
  308. sleep 2
  309.  
  310. %preun
  311. if test $1 = 0
  312. then
  313.   if test -x /etc/rc.d/init.d/mysql
  314.   then
  315.     /etc/rc.d/init.d/mysql stop > /dev/null
  316.   fi
  317.  
  318.   # Remove autostart of mysql
  319.   /sbin/chkconfig --del mysql
  320. fi
  321. # We do not remove the mysql user since it may still own a lot of
  322. # database files.
  323.  
  324. %clean
  325. [ "$RBR" != "/" ] && [ -d $RBR ] && rm -rf $RBR;
  326.  
  327. %files
  328. %defattr(-, root, root)
  329. %doc %attr(644, root, root) COPYING COPYING.LIB README
  330. %doc %attr(644, root, root) Docs/manual.{html,ps,texi,txt} Docs/manual_toc.html
  331. %doc %attr(644, root, root) support-files/my-*.cnf
  332.  
  333. %doc %attr(644, root, root) %{_infodir}/mysql.info*
  334.  
  335. %doc %attr(644, root, man) %{_mandir}/man1/isamchk.1*
  336. %doc %attr(644, root, man) %{_mandir}/man1/isamlog.1*
  337. %doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1*
  338. %doc %attr(644, root, man) %{_mandir}/man1/mysqld.1*
  339. %doc %attr(644, root, man) %{_mandir}/man1/mysqld_multi.1*
  340. %doc %attr(644, root, man) %{_mandir}/man1/safe_mysqld.1*
  341. %doc %attr(644, root, man) %{_mandir}/man1/perror.1*
  342. %doc %attr(644, root, man) %{_mandir}/man1/replace.1*
  343.  
  344. %attr(755, root, root) /usr/bin/isamchk
  345. %attr(755, root, root) /usr/bin/isamlog
  346. %attr(755, root, root) /usr/bin/my_print_defaults
  347. %attr(755, root, root) /usr/bin/myisamchk
  348. %attr(755, root, root) /usr/bin/myisamlog
  349. %attr(755, root, root) /usr/bin/myisampack
  350. %attr(755, root, root) /usr/bin/mysql_convert_table_format
  351. %attr(755, root, root) /usr/bin/mysql_fix_privilege_tables
  352. %attr(755, root, root) /usr/bin/mysql_install_db
  353. %attr(755, root, root) /usr/bin/mysql_setpermission
  354. %attr(755, root, root) /usr/bin/mysql_zap
  355. %attr(755, root, root) /usr/bin/mysqlbug
  356. %attr(755, root, root) /usr/bin/mysqld_multi
  357. %attr(755, root, root) /usr/bin/mysqldumpslow
  358. %attr(755, root, root) /usr/bin/mysqlhotcopy
  359. %attr(755, root, root) /usr/bin/mysqltest
  360. %attr(755, root, root) /usr/bin/pack_isam
  361. %attr(755, root, root) /usr/bin/perror
  362. %attr(755, root, root) /usr/bin/replace
  363. %attr(755, root, root) /usr/bin/resolve_stack_dump
  364. %attr(755, root, root) /usr/bin/resolveip
  365. %attr(755, root, root) /usr/bin/safe_mysqld
  366.  
  367. %attr(755, root, root) /usr/sbin/mysqld
  368. %attr(644, root, root) /usr/lib/mysql/mysqld.sym
  369.  
  370. %attr(644, root, root) /etc/logrotate.d/mysql
  371. %attr(755, root, root) /etc/rc.d/init.d/mysql
  372.  
  373. %attr(755, root, root) /usr/share/mysql/
  374.  
  375. %files client
  376. %defattr(-, root, root)
  377. %attr(755, root, root) /usr/bin/msql2mysql
  378. %attr(755, root, root) /usr/bin/mysql
  379. %attr(755, root, root) /usr/bin/mysql_find_rows
  380. %attr(755, root, root) /usr/bin/mysqlaccess
  381. %attr(755, root, root) /usr/bin/mysqladmin
  382. %attr(755, root, root) /usr/bin/mysqlbinlog
  383. %attr(755, root, root) /usr/bin/mysqlcheck
  384. %attr(755, root, root) /usr/bin/mysqldump
  385. %attr(755, root, root) /usr/bin/mysqlimport
  386. %attr(755, root, root) /usr/bin/mysqlshow
  387.  
  388. %doc %attr(644, root, man) %{_mandir}/man1/mysql.1*
  389. %doc %attr(644, root, man) %{_mandir}/man1/mysqlaccess.1*
  390. %doc %attr(644, root, man) %{_mandir}/man1/mysqladmin.1*
  391. %doc %attr(644, root, man) %{_mandir}/man1/mysqldump.1*
  392. %doc %attr(644, root, man) %{_mandir}/man1/mysqlshow.1*
  393.  
  394. %post shared
  395. /sbin/ldconfig
  396.  
  397. %postun shared
  398. /sbin/ldconfig
  399.  
  400. %files devel
  401. %defattr(644 root, root)
  402. %attr(755, root, root) /usr/bin/comp_err
  403. %attr(755, root, root) /usr/bin/mysql_config
  404. %dir %attr(755, root, root) /usr/include/mysql
  405. %dir %attr(755, root, root) /usr/lib/mysql
  406. /usr/include/mysql/*
  407. /usr/lib/mysql/*.a
  408.  
  409. %files shared
  410. %defattr(755 root, root)
  411. # Shared libraries (omit for architectures that don't support them)
  412. /usr/lib/*.so*
  413.  
  414. %files bench
  415. %defattr(-, root, root)
  416. %attr(-, root, root) /usr/share/sql-bench
  417. %attr(-, root, root) /usr/share/mysql-test
  418.  
  419. %files Max
  420. %defattr(-, root, root)
  421. %attr(755, root, root) /usr/sbin/mysqld-max
  422. %attr(644, root, root) /usr/lib/mysql/mysqld-max.sym
  423.  
  424. %changelog 
  425.  
  426. * Tue Sep 24 2002 Lenz Grimmer <lenz@mysql.com>
  427.  
  428. - MySQL-Max now requires MySQL to be the same version (to
  429.   avoid version mismatches e.g. mixing 3.23.xx and 4.0 packages)
  430.  
  431. * Thu Jul 30 2002 Lenz Grimmer <lenz@mysql.com>
  432.  
  433. - Use some more macros (mandir and infodir)
  434. - Updated package description
  435. - Install binaries stripped to save disk space
  436. - Rearranged file list (make sure man pages are in
  437.   the same package as the binaries)
  438. - clean up the BuildRoot directory afterwards
  439. - added mysqldumpslow to the server package
  440.  
  441. * Mon Jul 15 2002 Lenz Grimmer <lenz@mysql.com>
  442.  
  443. - updated Packager tag
  444.  
  445. * Fri Feb 15 2002 Sasha
  446.  
  447. - changed build to use --with-other-libc
  448.  
  449. * Fri Apr 13 2001 Monty
  450.  
  451. - Added mysqld-max to the distribution
  452.  
  453. * Tue Jan 2  2001  Monty
  454.  
  455. - Added mysql-test to the bench package
  456.  
  457. * Fri Aug 18 2000 Tim Smith <tim@mysql.com>
  458.  
  459. - Added separate libmysql_r directory; now both a threaded
  460.   and non-threaded library is shipped.
  461.  
  462. * Wed Sep 28 1999 David Axmark <davida@mysql.com>
  463.  
  464. - Added the support-files/my-example.cnf to the docs directory.
  465.  
  466. - Removed devel dependency on base since it is about client
  467.   development.
  468.  
  469. * Wed Sep 8 1999 David Axmark <davida@mysql.com>
  470.  
  471. - Cleaned up some for 3.23.
  472.  
  473. * Thu Jul 1 1999 David Axmark <davida@mysql.com>
  474.  
  475. - Added support for shared libraries in a separate sub
  476.   package. Original fix by David Fox (dsfox@cogsci.ucsd.edu)
  477.  
  478. - The --enable-assembler switch is now automatically disables on
  479.   platforms there assembler code is unavailable. This should allow
  480.   building this RPM on non i386 systems.
  481.  
  482. * Mon Feb 22 1999 David Axmark <david@detron.se>
  483.  
  484. - Removed unportable cc switches from the spec file. The defaults can
  485.   now be overridden with environment variables. This feature is used
  486.   to compile the official RPM with optimal (but compiler version
  487.   specific) switches.
  488.  
  489. - Removed the repetitive description parts for the sub rpms. Maybe add
  490.   again if RPM gets a multiline macro capability.
  491.  
  492. - Added support for a pt_BR translation. Translation contributed by
  493.   Jorge Godoy <jorge@bestway.com.br>.
  494.  
  495. * Wed Nov 4 1998 David Axmark <david@detron.se>
  496.  
  497. - A lot of changes in all the rpm and install scripts. This may even
  498.   be a working RPM :-)
  499.  
  500. * Sun Aug 16 1998 David Axmark <david@detron.se>
  501.  
  502. - A developers changelog for MySQL is available in the source RPM. And
  503.   there is a history of major user visible changed in the Reference
  504.   Manual.  Only RPM specific changes will be documented here.
  505.